const mongoose = require("mongoose");
const { Schema } = mongoose;

// 草稿规则
const DraftSchema = new Schema({
  // 标题
  title: { type: String, required: false },
  // 简介
  summary: { type: String, required: false },
  // 作者昵称
  authorNickName: { type: String, required: true },
  // 作者email，相当于用户的唯一标识
  authorEmail: { type: String, required: true },
  // 草稿内容
  content: { type: String, required: false },
  // 创建时间
  createdTime: { type: Date, default: Date.now },
});

module.exports = {
  DraftSchema,
};
